package com.ruoyix.ai.mapper;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.ruoyix.ai.domain.AiChatMessage;
import com.ruoyix.ai.domain.vo.AiChatMessageVo;
import com.ruoyix.common.core.mapper.BaseMapperPlus;

import java.util.List;

/**
 * AI 聊天消息Mapper接口
 *
 * @author ruoyi
 * @date 2024-09-21
 */
public interface AiChatMessageMapper extends BaseMapperPlus<AiChatMessageMapper, AiChatMessage, AiChatMessageVo> {

    default List<AiChatMessage> selectListByConversationId(Long conversationId) {
        return selectList(new LambdaQueryWrapper<AiChatMessage>()
            .eq(AiChatMessage::getConversationId, conversationId)
            .orderByAsc(AiChatMessage::getId));
    }

}
